import unittest

from FluidClass.FluidSettings import FluidSettings
from ResistanceClass.CurveCircleSmoothSharpWallPipe import CurveCircleSmoothSharpWallPipe as pype

# Вводим значения длины трубы и диаметра (СИ)
diameter = 0.02
bend_angle = 90
superclass = pype(FluidSettings(), diameter, bend_angle)

# Вводим значения из Экселя, меняем запятые на точку
Reynolds = 71210.265366
Lambda = 0.01987
Velocity = 3.192676893
area = 0.000314159

Total_Resistance = 1.17513
PressureDrop = 5971.166295
psy = 0.98750
A = 1.32

# Точность (оптимально от 2 до 4)
quality = 1


class GeneralParameters(unittest.TestCase):

    def test1_Reynolds(self):
        self.assertEqual(round(superclass.reynolds_number(), quality), round(Reynolds, quality))

    def test2_Lambda(self):
        self.assertEqual(round(superclass.resistance_coefficient_lambda(), quality), round(Lambda, quality))

    def test3_PressureDrop(self):
        self.assertEqual(round(superclass.pressure_drop(), quality), round(PressureDrop, quality))

    def test4_Velocity(self):
        self.assertEqual(round(superclass.velocity(), quality), round(Velocity, quality))

    def test5_Area(self):
        self.assertEqual(round(superclass.area(), quality), round(area, quality))

    def test6_Total_Resistance(self):
        self.assertEqual(round(superclass.total_resistance_coefficient(), quality), round(Total_Resistance, quality))

    def test7_A(self):
        self.assertEqual(round(superclass.definition_A(), quality), round(A, quality))

    def test8_psy(self):
        self.assertEqual(round(superclass.definition_psy(), quality), round(psy, quality))


if __name__ == '__main__':
    unittest.main()
